logo of company

Monthly Emergency Room (ER) Report


This report analyzes the emergency room operations at Taif Children’s Hospital for the month of September 2024. The focus of this month’s report is on understanding peak hours of patient visits, volume, average wait times, triage levels and operational metrics. Recommendations will be provided based on these findings to help enhance patient care and operational efficiency.

Author: Joan Jimenez

Date: October 19, 2024

Introduction

This comprehensive report examines emergency department (ER) operations, focusing on critical key performance indicators (KPIs) that reflect the efficiency and effectiveness of patient care from triage to treatment.It analyzes patient visit metrics to measure overall demand and examines the time from door to doctor, providing insights into initial response times. The report also looks into the duration from doctor to decision, highlighting the speed at which healthcare providers can evaluate and decide on necessary interventions. For more information visit Emergency Room (ER)

While the default Quarto appearance looks great, there are a few tweaks I always apply to elevate the report even further. Rather than manually adding them each time, I bundled everything into a custom format called lumo.

Btw, you can learn how to master Quarto thanks to my online course: Productive R Workflow

This document aims at showcasing how versatile the lumo format is. With a few tweaks, I made it fit the brand of a specific company.

Patients Visits

Analyze patterns in patient visits over time to identify peak hours, seasonal variations, and the overall demand for emergency services.By identifying trends and patterns in patient visits, we aim to optimize the quality of care and improve operational effectiveness.

Key Metrics:

  • Total Patient Visits: 12,500
  • Average Daily Visits: 139
  • Peak Hour: 5 PM – 8 PM
  • Percentage of Non-Urgent Visits: 30%
  • Percentage of Urgent Visits: 70%
  • Average Wait Time (Door to Doctor): 20 minutes

Notice that the code chunks are folded by default. You can adjust this behavior with the code-fold option in the document’s YAML header.

By the way, you should open the code chunk that is folded above. ⬆️ There is a little stunning surprise on its right hand side.

ER Time Series

I strongly advise to create a dataviz theme that fits your company’s brand. Here is one:

And now let’s use it on a graph:

Patient Traffic

For a complete list of features, visit the documentation!

Oh and since we’re here, did you know you can easily include a full width interactive map with leaflet in a quarto doc? 😍

Code
knitr::include_url({"/docs/interactive/patients_traffic.html"})

Interactive table

It is very easy to insert an interactive table in your document thanks to the DT package. The output allows to filter rows, search for something and sort using a specific columns!

Install the library with install.packages("DT"). Then, just pass a dataframe to the datatable() function to get a stunning interactive output!

Code
library(DT)
data(iris)

# Make a table
datatable(iris, filter = "top")







I’ve added a bit of CSS to make the font smaller on DT tables by the way 🙂

A grey section

It’s always good to have a grey section. Makes the document breath a bit. I’ve added a little utility class in Lumo to make sure you can make sections like this very easily. Check the documentation!

Let’s use this space to render a little equation:

\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]

Quarto Tricks

Lumo is a great format, but to get the most out of it, you’ll need to master a few Quarto tricks!

The good news? I’ve compiled my 30+ favorite tips in one place. Just spend 30 minutes, and you’ll be up to speed with all of them!


For example, if you’re creating multiple plots, each highlighting different aspects of your dataset, consider using pills to organize them!

More Information

Learn how to use and how to customize Lumo here.

Session Info

When creating a Quarto document, it’s a good practice to include details about your working environment.

This is easy to do—just call sessionInfo(), and it will print out all your R and package versions. This simple step greatly enhances reproducibility.

Code
sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] DT_0.33           patchwork_1.3.0   viridis_0.6.5     viridisLite_0.4.2
 [5] hrbrthemes_0.8.7  lubridate_1.9.3   forcats_1.0.0     stringr_1.5.1    
 [9] dplyr_1.1.4       purrr_1.0.2       readr_2.1.5       tidyr_1.3.1      
[13] tibble_3.2.1      ggplot2_3.5.1     tidyverse_2.0.0  

loaded via a namespace (and not attached):
 [1] sass_0.4.9              utf8_1.2.4              generics_0.1.3         
 [4] fontLiberation_0.1.0    renv_1.0.10             stringi_1.8.4          
 [7] extrafontdb_1.0         hms_1.1.3               digest_0.6.37          
[10] magrittr_2.0.3          evaluate_1.0.0          grid_4.4.0             
[13] timechange_0.3.0        fastmap_1.2.0           jsonlite_1.8.9         
[16] gridExtra_2.3           fansi_1.0.6             crosstalk_1.2.1        
[19] scales_1.3.0            fontBitstreamVera_0.1.1 jquerylib_0.1.4        
[22] cli_3.6.3               rlang_1.1.4             fontquiver_0.2.1       
[25] munsell_0.5.1           cachem_1.1.0            withr_3.0.1            
[28] yaml_2.3.10             gdtools_0.4.0           tools_4.4.0            
[31] tzdb_0.4.0              colorspace_2.1-1        vctrs_0.6.5            
[34] R6_2.5.1                lifecycle_1.0.4         htmlwidgets_1.6.4      
[37] pkgconfig_2.0.3         bslib_0.8.0             pillar_1.9.0           
[40] gtable_0.3.5            glue_1.8.0              Rcpp_1.0.13            
[43] systemfonts_1.1.0       highr_0.11              xfun_0.48              
[46] tidyselect_1.2.1        knitr_1.48              farver_2.1.2           
[49] extrafont_0.19          htmltools_0.5.8.1       rmarkdown_2.28         
[52] Rttf2pt1_1.3.12         compiler_4.4.0